import https from '../../request'

// 商品分类列表
export const getCategoriesList = (params) => https.get('categories', { params })

// 添加
export const getaddCategories = (params) => https.post('categories', params)

// 修改
export const editCategories = (params) => https.put(`categories/${params.id}`, { cat_name: params.cat_name })

// 删除
export const deleteCategories = (params)=>https.delete(`categories/${params.id}`)

// 获取分类参数列表
export const getparamsList = (params) => https.get(`categories/${params.cat_id}/attributes`, {
    params:{sel:params.sel}
})

// 添加动态参数或静态属性
export const getcateglst = (params) => https.put(`categories/${params.id}/attributes/${params.attrId}`, params)

// 添加参数
export const addcateglist = (params) => https.post(`categories/${params.id}/attributes`, params)

// 删除参数
export const delcateglist = (params) => https.delete(`categories/${params.id}/attributes/${params.attrid}`)

// 修改参数
export const editcateglst = (params) => https.put(`categories/${params.id}/attributes/${params.attrId}`, params)

// 获取商品列表
export const getgoodslist = (params) => https.get('goods', { params })

// 删除商品
export const deletegoodlist = (params) => https.delete(`goods/${params.id}`)

// 添加商品
export const addgoodlist = (params) => https.post(`goods`, params)

// 获取添加商品参数
export const getaddgoodslist = (params)=>https.get(`categories/${params.id}/attributes`,{ params:{sel:params.sel}})